/*
 * @Author: iy88 
 * @Date: 2020-05-17 16:41:28 
 * @Last Modified by: iy88
 * @Last Modified time: 2020-05-30 18:21:58
 */
const express = require('express');
const app = express();
const path = require('path');
app.disable('x-powered-by');
app.use((req,res,next)=>{
  console.log(new Date(),req.method,req.url,req.ip);
  next();
})
app.use('/', express.static(path.normalize(path.resolve(__dirname, '../public'))));
app.use((req, res) => {
  res.status(404);
  res.send();
});
app.use((err, req, res) => {
  console.error(err.stack);
  res.status(500);
  res.send();
});
module.exports = app;